<template>
    <view class="container">
        <view class="title">
            <text class="title-left">
                {{ categoryQuestion[item.category - 1] }}
            </text>
            <text class="title-right" v-if="item.completedQuestions == item.totalNum">
                已完成
            </text>
            <text class="title-right-none" v-else>
                未完成
            </text>
        </view>
        <view class="bottom">
            <text class="bottom-left">
                题目数量:{{ item.totalNum }}
            </text>
            <text class="bottom-right">
                {{ item.completedQuestions }}/{{ item.totalNum }}
            </text>
        </view>
    </view>

</template>
<script setup lang="ts">
import { categoryQuestion } from '@/utils/hook';
import type { QuestionRecord } from '@/type/question';
const prop = defineProps<{
    item: QuestionRecord
}>();
</script>
<style scoped lang="scss">
.container {
    padding: 30rpx;
    margin: 20rpx;
    font-size: 32rpx;
    border-radius: 10rpx;
    color: #666;
    background-color: #fff;
    box-shadow: $shadow;

    .title {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20rpx;

        &-right {
            background-color: #d0f0cc;
            border-radius: 28rpx;
            padding: 10rpx 20rpx;
            font-size: 28rpx;
            color: #3cb64c
        }
        &-right-none {
            background-color: #f4d0c7;
            border-radius: 28rpx;
            padding: 10rpx 20rpx;
            font-size: 28rpx;
            color: #cf3636
        }
    }

    .bottom {
        font-size: 28rpx;
        display: flex;
        justify-content: space-between;
    }
}
</style>
